﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using Fayshine.VA.RIAService.Web;
using Fayshine.VA.ViewModels;
using Fayshine.VA.Models;
using Visifire.Charts;


namespace Fayshine.VA.Helpers
{
    public static class ChartHelper
    {
        public static DataSeries GetDataSeries(RenderAs type, string title,ChartValueTypes xValueType)
        {
            DataSeries series = new DataSeries();
            
            switch (type)
            {
                case RenderAs.Line:
                    series.RenderAs = RenderAs.Line;
                    series.LegendText = title;
                    series.XValueType = xValueType;
                    series.LineThickness = 2;
                    series.MarkerSize = 5;
                    break;
                case RenderAs.Column:
                    series.RenderAs = RenderAs.Column;
                    series.LegendText = title;
                    series.XValueType = xValueType;
                    series.Width = 10;
                    
                    break;
                case RenderAs.Area:
                    series.RenderAs = RenderAs.Area;
                    series.XValueType = xValueType;
                    series.LegendText = title;
                    break;
                case RenderAs.Pie:
                    series.RenderAs = RenderAs.Pie;
                    series.XValueType = xValueType;
                    series.LegendText = title;
                    break;
                case RenderAs.Point:
                    series.MarkerType = Visifire.Commons.MarkerTypes.Circle;
                    series.RenderAs = RenderAs.Point;
                    series.XValueType = xValueType;
                    series.LegendText = title;
                    break;
            }
            return series;
        
        }

        public static DataMapping GetDataMapping(string memberName, string path)
        {
            DataMapping mappingItem = new DataMapping();
            mappingItem.MemberName = memberName;
            mappingItem.Path = path;
            return mappingItem;
        }
    }
}
